<?php

use think\facade\Request;
use think\facade\Route;


Route::post(":version.login", ':version.Login/doLogin');
Route::get(":version.random_template", ':version.Study/getTopicList');
Route::get(":version.test", ':version.Study/monthlyCheck');
Route::get(":version.sync_redis", ':version.System/syncRedis');
Route::get(":version.tj_test", ':version.Test/tj_test');
Route::get(":version.sjb", ':version.Test/sjb');
Route::get(":version.la", ':version.Test/la');
//预览
Route::post(':version.preview_exam', ':version.System/importUnit');
Route::group(':version.admin', function () {
    //获取用户信息
    Route::get('admin_show', ':version.Login/adminShow');
    //用户列表
    Route::get('admin_list', ':version.Admin/adminList');
    //用户更新
    Route::get('update_show/:id', ':version.Admin/adminUpdateShow');
    //用户保存
    Route::post('admin_save', ':version.Admin/adminSave');
    //删除用户
    Route::get('admin_delete/:id', ':version.Admin/adminDelete');

    //新增and编辑角色
    Route::post('save_role', ':version.Role/saveRole');
    //获取菜单权限
    Route::get('permission', ':version.Menu/menuPermission');
    //新增and编辑菜单
    Route::post('save_menu', ':version.Menu/saveMenu');
    //删除菜单
    Route::post('del_menu', ':version.Menu/delMenu');
    //菜单列表
    Route::get('menu_list', ':version.Menu/MenuInfo');
    //获取角色列表
    Route::get('role_list', ':version.Role/roleList');
    //删除角色
    Route::delete('del_role/:id/:role_id', ':version.Role/delRole');
    //删除角色组
    Route::delete('del_group/:id', ':version.Role/groupDel');
    //更改角色状态
    Route::put('update_role_status/:id/:status', ':version.Role/updateRoleStatus');
    //读取所有角色
    Route::get('role_info_list', ':version.Role/roleInfoList');
    //保存中间表角色
    Route::post('set_role_user_pivot', ':version.Role/setRoleUserPivot');
    //获取菜单类别
    Route::get('menu_type', ':version.Menu/MenuType');
    //根据父级节点获取对应的权限菜单
    Route::post('allot_menu_auth', ':version.Role/allotMenuAuth');

    //模版列表
    Route::get('template_list', ':version.TemplateCon/templateList');
    //保存模版
    Route::post('save_template', ':version.TemplateCon/saveTemplate');
    //删除角色组
    Route::delete('template_delete/:id', ':version.TemplateCon/templateDel');
    //导入数据
    Route::post("import_excel", ':version.TemplateCon/importExcel');

    //监测问卷下是否有数据
    Route::get('check_question/:id', ':version.TemplateCon/checkQuestion');
    //根据模版id 获取对应的分类
    Route::get('template_type_list', ':version.TemplateCon/templateTypeList');
    //修改模版详情
    Route::post("update_detail_template", ':version.TemplateCon/updateDetailTemplate');
    //修改模版大类别
    Route::post("update_template", ':version.TemplateCon/updateTemplate');
    //修改模版二级类别
    Route::post("update_second_level", ':version.TemplateCon/updateSecondLevel');
    //
    Route::post("get_two_template", ':version.TemplateCon/getTwoTemplate');

    //新增
    Route::post("add_template", ':version.TemplateCon/addTemplate');
    //下载数据模板文件
    Route::get('download_file', ':version.TemplateCon/downloadFile');

    //行业数据列表
    Route::get('get_industry_list', ':version.System/getIndustryList');
    //保存行业
    Route::post("save_industry", ':version.System/saveIndustry');
    //删除
    Route::delete('industry_delete/:id', ':version.System/industryDel');

    //行业数据列表
    Route::get('get_unit_list', ':version.System/getUnitList');
    //行业数据列表
    Route::get('read_unit_list', ':version.System/readUnitList');
      //行业数据列表
    Route::get('get_attribute', ':version.System/readAttribute');
    //保存单位
    Route::post("save_unit", ':version.System/saveUnit');
    //删除
    Route::delete('unit_delete/:id', ':version.System/UnitDel');

    //数据源
    Route::get('wechat_list', ':version.Wechat/wechatList');
    //微信前端用户
    Route::post("wechat_save", ':version.Wechat/wechatSave');
    //删除
    Route::delete('wechat_delete/:id', ':version.Wechat/wechatDelete');

    //数据列表
    Route::get('get_exam_list', ':version.ExamCon/getExamList');
    //获取类别
    Route::get('get_exam_type', ':version.ExamCon/getExamType');
    //保存
    Route::post("save_exam", ':version.ExamCon/saveExam');
    //预览
    Route::post('preview_exam', ':version.ExamCon/previewExam');
    //预览更改分值
    Route::post('change_score', ':version.ExamCon/changeExamScore');
    //删除问卷细则
    Route::delete('exam_detail_delete/:id', ':version.ExamCon/examDetailDelete');
    //根据问卷id 获取详情
    Route::get('get_exam_show/:id', ':version.ExamCon/getExamShow');
    //保存细则
    Route::post('save_detail', ':version.ExamCon/saveExamDetail');
    //删除问卷
    Route::delete('exam_delete/:id', ':version.ExamCon/examDelete');
    //发布and撤回
    Route::post('exam_release_and_withdraw', ':version.ExamCon/examReleaseAndWithdraw');

    //保存随机生成还是全部生成
    Route::post('save_randomAndAll', ':version.ExamCon/saveExamRandomAndAll');

    //获取操作日志
    Route::get('get_admin_log', ':version.Log/getAdminLogList');
    //更新个人资料
    Route::post('update_personal', ':version.Log/updatePersonalData');

    //文章类别
    Route::get('article_type', ':version.Article/getArticleTypeList');

    //上传封面
    Route::post('upload_img', ':version.Article/UploadImg');
    Route::post('del_file', ':version.Article/delFile');
    //保存文章
    Route::post('save_article', ':version.Article/saveArticle');
    //文章数据源列表
    Route::get('article_list', ':version.Article/getArticleList');
    //删除
    Route::delete('article_delete/:id', ':version.Article/delArticle');
    /**
     * 配置 -- 轮播图
     */
    Route::post("save_carousel", ':version.System/saveCarousel');
    //列表
    Route::get("get_carousel_list", ':version.System/getCarouselList');
    //获取唯一信息
    Route::get('carousel_show/:id', ':version.System/getShowCarousel');
    //删除跑马灯
    Route::delete('carousel_delete/:id', ':version.System/deleteCarousel');
    //获取轮播图类别
    Route::get("get_carousel_type", ':version.System/getCarouseType');
    //保存配置
    Route::post("save_system_config", ':version.System/saveSystemConfig');
    //获取配置
    Route::get("get_system_config", ':version.System/getSystemConfig');

    //导入题库
    Route::post('import_study_excel', ':version.Study/importStudyExcel');
    //数据源
    Route::get("get_study_list", ':version.Study/getStudyList');
    //根据题目分类id获取题库
    Route::get("get_study_topic", ':version.Study/getStudyTopicList');
    //删除
    Route::delete('study_delete/:id', ':version.Study/delStudy');
    //答题类型
    Route::get("get_study_type", ':version.Study/studyType');
    Route::get("get_study_wx_auth", ':version.Study/getStudyWxAuth');

    //审核数据源
    Route::get("get_audit_exam", ':version.Audit/getAuditExamList');
    //审核未上传数据源
    Route::get("get_not_audit_exam", ':version.Audit/getNotAuditExamList');

    //审核
    Route::get("check_step_log", ':version.Audit/getStepLogList');

    //获取审核步骤
    Route::get("check_step", ':version.Audit/getStep');


    Route::get("avg_audit_exam_score", ':version.Audit/avgAuditExamScore');
    //问卷退回
    Route::post('give_back_exam', ':version.Audit/giveBackExam');

    //审核问卷
    Route::post('audit_exam', ':version.Audit/auditExam');
    //保存扣分
    Route::post('save_ultimately_score', ':version.Audit/saveUltimatelyScore');
    //提交审核问卷
    Route::post('submit_audit_exam', ':version.Audit/submitAuditExam');
    //完全符合
    Route::post('exact_match_audit_exam', ':version.Audit/exactMatchAuditExam');
    //完全不符
    Route::post('exact_match_discrepancy', ':version.Audit/exactMatchDiscrepancy');
    //单位筛选 --- 所有 包含专项
    Route::get("get_filter_list", ':version.DataCenter/getFilterMenuList');
    //单位筛选 --- 去除专项
    Route::get("get_filter_pt", ':version.DataCenter/getFilterMenuListPT');
    //所有用户
    Route::get("get_user_list", ':version.DataCenter/getUserDataInfo');
    //答题用户
    Route::get("get_user_dt", ':version.DataCenter/getUserDt');


    //获取网点属性
    Route::get("get_attribute", ':version.Audit/getAttributeList');

    //网点排行
    Route::get("unit_rank", ':version.DataCenter/unitRank');
    //扣分统计
    Route::get('points_count', ':version.DataCenter/pointsCount');
    //获取报告详情
    Route::post('get_report_detail', ':version.Audit/getReportDetail');
    //照片库
    Route::get("get_photo_library_list", ':version.DataCenter/getPhotoLibraryList');
    //上传统计
    Route::get("upload_statistical", ':version.DataCenter/uploadStatistical');
    //导出问卷
    Route::post('import_exam_excel', ':version.DataCenter/importExcel');

    //保存微信菜单--PC
    Route::post('save_wx_menu', ':version.WxMenuCon/saveMenu');
    //保存微信角色--PC
    Route::post('wx_role_menu', ':version.WxMenuCon/saveWxMenuRole');
    //微信角色列表
    Route::get('get_wx_role_list', ':version.WxMenuCon/getWxRoleList');

    Route::delete('delete_wx_role/:id', ':version.WxMenuCon/deleteWxRole');
    //菜单数据源
    Route::get('get_wx_menu_list', ':version.WxMenuCon/getWxMenuList');
    //保存微信权限菜单
    Route::post('save_auth_wx_menu', ':version.WxMenuCon/saveAuthWxMenu');
    //保存微信题库权限
    Route::post('save_auth_wx_study', ':version.WxMenuCon/saveAuthWxStudy');
    //获取微信菜单权限
    Route::post('get_auth_wx_menu_list', ':version.WxMenuCon/getAuthWxMenuList');
    //获取微信题库权限
    Route::post('get_auth_wx_study_list', ':version.WxMenuCon/getAuthWxStudyList');
    //上传文件
    Route::post('save_knowLedge', ':version.KnowLedgeCon/saveKnowLedge');
    //文件数据源
    Route::get('get_knowLedge', ':version.KnowLedgeCon/getKnowLedgeInfo');
    //保存文件夹
    Route::post('save_folder', ':version.KnowLedgeCon/saveKnowLedgeFolder');
    //文件夹数据源
    Route::get('get_folder', ':version.KnowLedgeCon/getKnowLedgeFolderList');
    //删除文件
    Route::delete('knowLedge_delete/:id', ':version.KnowLedgeCon/delKnowLedge');
    //按天统计
    Route::get('get_day_statistics', ':version.Study/getDayStatisticsList');
    //按月统计
    Route::get('get_month_statistics', ':version.Study/getMonthStatisticsList');
    //统计未上传的单位
    Route::post('not_upload_unit', ':version.Study/notUploadUnit');
    //网点
    Route::get('get_DsTj', ':version.Statistics/unitPm');
    //单一网点
    Route::get('get_unit_person', ':version.Statistics/getUnitPerson');

    //统计（每日答题） --图标
    Route::get('echarts_unit', ':version.Statistics/echartsUnit');
    //月考
    Route::get('monthly_check', ':version.Study/monthlyCheck');
    //月考详情
    Route::get('person_monthly_check', ':version.Study/personMonthlyDetail');
})->middleware(\app\api\middleware\v1\AuthAdmin::class);

//微信不验证
Route::group(':version/wx', function () {
    //获取token
    Route::post('get_token', ':version.Wechat/getToken');   //小程序获取用户token
    //验证token
    Route::post('token_verify', ':version.Wechat/tokenVerify');
    //微信用户登录
    Route::post('wx_login', ':version.Wechat/wxLogin');
    //获取轮播图
    //列表
    Route::get("get_carousel_list", ':version.System/getCarouselList');
    //文章列表
    Route::get('article_list', ':version.Article/getArticleList');
    //获取文章唯一信息
    Route::get('article_show', ':version.Article/getShowArticle');
    //获取文章类别
    Route::get('article_type', ':version.Article/getArticleTypeList');
    //getWxArticleList
    Route::get('wx_article_list', ':version.Article/getWxArticleList');
    //数据源
    Route::get("get_study_list", ':version.Study/getStudyList');
    //获取配置
    Route::get("get_system_config", ':version.System/getSystemConfig');
    //关于我们
    Route::get("get_about_me", ':version.System/getAboutMeInfo');
    //菜单数据源--wx
    Route::get('get_wx_menu_info', ':version.WxMenuCon/getWxMenuInfo');
    //题库数据源--wx
    Route::get('get_wx_study_info', ':version.WxMenuCon/getWxStudyInfo');
    //所有菜单数据源--wx
    Route::get('get_wx_menu_more', ':version.WxMenuCon/getWxMenuInfoMore');

    Route::get("home_day_count", ':version.Statistics/homeTj');
});

//验证
Route::group(':version/auth_wx', function () {

    Route::get('get_exam_info', ':version.Audit/getExamQuestionInfo');
    //zhuanxiang
    Route::get('get_exam_zx', ':version.Audit/getExamZxs');

    Route::get('get_exam_detail', ':version.Audit/getExamDetail');
    //根据id 获取对应的题目
    Route::get('get_topic_list', ':version.Study/getTopicList');
    //收藏
    Route::post('collection_topic', ':version.Study/collectionTopic');
    //保存题目
    Route::post('save_topic', ':version.Study/saveTopic');
    //上传每日一检的图片
    Route::post('upload_exam_img', ':version.Audit/UploadImg');
    Route::post('save_audit_exam', ':version.Audit/saveAuditExam');
    //专项保存
    Route::post('save_zx_audit_exam', ':version.Audit/saveZxAuditExam');
    Route::post('del_img_zx', ':version.Audit/delImgZx');

    //检测详情
    Route::post('check_audit_detail', ':version.Audit/checkAuditDetailIds');
    //专项
    Route::post('check_audit_zx', ':version.Audit/checkAuditZxIds');

    Route::post('show_audit_detail', ':version.Audit/showAuditDetail');
    //专项检查详情
    Route::post('show_audit_zx_detail', ':version.Audit/showAuditDetailZx');

    //报告记录
    Route::get('get_audit_exam_user', ':version.Audit/getAuditExamUserList');
    //获取报告详情
    Route::post('get_report_detail', ':version.Audit/getReportDetail');
    //获取题目记录
    Route::get('topic_exercise_log', ':version.Study/getTopicExerciseLog');
    //照片库
    Route::get("get_photo_library_list", ':version.DataCenter/getPhotoLibraryList');
    //单位筛选 -- 带有专项
    Route::get("get_filter_list", ':version.DataCenter/getFilterMenuList');
    //单位筛选 --- 去除专项
    Route::get("get_filter_pt", ':version.DataCenter/getFilterMenuListPT');

    //是否上传案件统计
    Route::get("is_upload_unit", ':version.DataCenter/isUploadUnit');
    //网点统计点击详情
    Route::get("unit_detail", ':version.DataCenter/unitDetail');
    //日常检查统计
    Route::get('daily_check', ':version.DataCenter/dailyCheck');
    //扣分统计
    Route::get('points_count', ':version.DataCenter/pointsCount');

    //网点排行
    Route::get("unit_rank", ':version.DataCenter/unitRank');

    //月报表
    Route::get("monthly_report", ':version.DataCenter/monthlyReport');
    //答题记录
    Route::get("study_record", ':version.DataCenter/studyRecord');
    //监测问卷
    Route::get('check_upload_exam_file', ':version.Audit/checkUploadExamFile');
    //微信头像
    Route::post('wx_upload_img', ':version.DataCenter/WxUploadImg');
    //更改用户信息
    Route::post('change_user_info', ':version.DataCenter/changeUserInfo');
    //更改密码
    Route::post('change_password', ':version.DataCenter/changePassword');
    //customAddUnit 自定义添加单位
    Route::post('custom_add_unit', ':version.Audit/customAddUnit');
    //保存签名
    Route::post('save_sign', ':version.Audit/saveSign');
    //专项网点获取
    Route::get('get_zx_unit_list', ':version.Audit/getZxUnitList');

    //专项单点报告数据列表
    Route::get('get_special_exam_list', ':version.Special/getSpecialExamList');
    //获取网点的样本图片列表
    Route::get('get_special_file', ':version.Special/getSpecialFileList');

    //监测微信菜单是否被标记 重定向不同的页面
    Route::post('check_user_menu_auth', ':version.Study/checkUserMenuAuth');
    //文件夹数据源
    Route::get('get_folder', ':version.KnowLedgeCon/getKnowLedgeFolderList');

    //文件数据源
    Route::get('get_knowLedge', ':version.KnowLedgeCon/getKnowLedgeInfo');
    //获取考试题目
    Route::get('get_exam_study_list', ':version.Study/getExamStudyList');

    //按天统计
    Route::get('get_day_statistics', ':version.Study/getDayStatisticsList');
    //统计未上传的单位
    Route::get('not_upload_unit', ':version.Study/notUploadUnit');
    //按月统计
    Route::get('get_month_statistics', ':version.Study/getMonthStatisticsList');
    //排行榜
    Route::get('rand_month', ':version.Statistics/randMonth');
    //网点
    Route::get('get_DsTj', ':version.Statistics/unitPm');
    Route::get('get_tj_unit', ':version.Statistics/getDsTj');
    Route::get('get_unit_user', ':version.Statistics/getUnitUser');

    //保存单一的学习答题
    Route::post('save_single_topic', ':version.Study/saveSingleTopic');

    //单一网点
    Route::get('get_unit_person', ':version.Statistics/getUnitPerson');
    Route::get('get_check_unit_person', ':version.Statistics/getCheckUnitPerson');
    Route::get('wd_person', ':version.Admin/wdPerson');
    //获取当前单位下的所有用户
    Route::get('get_unit_admins', ':version.Statistics/getUnitAdmins');
    Route::get('get_unit_list_all', ':version.Statistics/getUnitListAll');
    //保存当前申请的转网信息
    Route::post('change_unit', ':version.Statistics/changeUnit');
    //获取转网记录
    Route::get('get_change_unit', ':version.Statistics/getChangeUnitLog');
    //审核下级单位的申请记录
    Route::get('get_is_audit_unit', ':version.Statistics/getIsAuditUnit');
    //审核
    Route::post('save_is_audit_unit', ':version.Statistics/saveIsAudit');
    //入网
    Route::post('enter_unit', ':version.Statistics/enterUnit');
    //检查用户单位
    Route::get('check_unit_id', ':version.Statistics/checkIsChangeUnitId');

    Route::post('enter_unit', ':version.Statistics/enterUnit');
    //移除用户
    Route::post('remove_user', ':version.Statistics/removeUser');
    //回收用户列表
    Route::get('recovery_person', ':version.Statistics/recoveryPerson');
    //恢复人员事件
    Route::post('recovery_user_event', ':version.Statistics/recoveryUserEvent');
    //添加单位人员
    Route::post('add_unit_user', ':version.Statistics/addUnitUser');
    //根据名称查询人员
    Route::get('select_unit_person', ':version.Statistics/selectUnitPerson');
    //未答题人员
    Route::get('no_answer_person', ':version.Statistics/noAnswerPerson');
    //获取网点信息下级
    Route::get('get_xj_unit', ':version.Statistics/getXjUnit');
    //重置密码
    Route::post('pwd_reset', ':version.System/passwordReset');
    //同步账号信息
    Route::post('sync_account', ':version.System/syncAccount');
    //月考
    Route::get('monthly_check', ':version.Study/monthlyCheck');
    //月考详情
    Route::get('person_monthly_check', ':version.Study/personMonthlyDetail');

    Route::post("test", ':version.DataCenter/test1');

    //每个网点遇到特殊清空时 没有上传问卷 只针对六安 固话问卷
    Route::post('no_upload_exam', ':version.ExamCon/notUploadExam');
    //已删除用户题目替换
    Route::post('replace_user', ':version.ExamCon/replaceUserExam');
})->middleware(\app\api\middleware\v1\WxAuth::class);
